package com.lei.cmsservice.controller;

import com.lei.cmsservice.entity.CrmBanner;
import com.lei.cmsservice.service.CrmBannerService;
import com.lei.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by IntelliJ
 * Author:熊磊
 */
@RestController
@RequestMapping("/edu/banner")
//前台显示banner
public class BannerFrontController {
    @Autowired
    private CrmBannerService bannerService;

    //获得所有Banner
    @GetMapping("/getAllBanner")
    public Result index(){
        List<CrmBanner> list=bannerService.selectAllBanner();
        return Result.ok().data("list",list);
    }
}
